#include <stdio.h>

// 枚举遍历 | 枚举在分支结构的使用

int main(){
    enum Weekday{
        MONDAY,
        TUESDAY,
        WEDNESDAY,
        THURSDAY,
        FRIDAY,
        SATURDAY,
        SUNDAY
    };

    int temp;
    enum Weekday day = WEDNESDAY;
    printf("%d\n", day);

    for(day = MONDAY; day <= SUNDAY; day++){
        printf("%d\n", day);
    }

    printf("输入今天的日期");
    fflush(stdout);
    scanf("%d", &temp);
    day = (enum Weekday)temp;
    switch (day)
    {
    case MONDAY:
        printf("今天是星期一\n");
        break;
    case TUESDAY:
        printf("今天是星期二\n");
        break;
    case WEDNESDAY:
        printf("今天是星期三\n");
        break;
    case THURSDAY:
        printf("今天是星期四\n");
        break;
    case FRIDAY:
        printf("今天是星期五\n");
        break;
    case SATURDAY:
        printf("今天是星期六\n");
        break;
    case SUNDAY:
        printf("今天是星期日\n");
        break;
    
    default:
        break;
    }


    return 0;
}